getApp();

var t = require("../../../utils/themeSkin/skinBehavior");

Page({
    behaviors: [ t ],
    data: {
        discoverInfo: [],
        hotInfo: [],
        hotPage: 1,
        hotLastPage: 0,
        hotTap: !1,
        keyWord: "",
        searchHistory: [],
        city: "",
        latitude: "",
        longitude: "",
        cityCode: ""
    },
    onLoad: function(t) {
        var a, o;
        console.log(t), "" !== (null !== (a = t.keyWord) && void 0 !== a ? a : "") && this.setData({
            keyWord: t.keyWord.trim()
        }), "" !== (null !== (o = t.city) && void 0 !== o ? o : "") && this.setData({
            city: t.city,
            latitude: t.latitude,
            longitude: t.longitude,
            cityCode: t.cityCode
        }), this.setData({
            city: t.city,
            cityCode: t.cityCode,
            latitude: t.latitude,
            longitude: t.longitude
        });
    },
    onReady: function() {},
    searchKey: function(t) {
        this.setData({
            keyWord: t.detail.value
        });
    },
    confirmTap: function(t) {
        this.setData({
            keyWord: t.detail.value
        }), this.data.keyWord && wx.navigateTo({
            url: "/packageF/tourAround/tourSearchPage/tourSearchPage?keyword=".concat(this.data.keyWord, "&city=").concat(this.data.city, "&latitude=").concat(this.data.latitude, "&longitude=").concat(this.data.longitude, "&cityCode=").concat(this.data.cityCode)
        });
    },
    goSearch: function() {
        this.data.keyWord && wx.navigateTo({
            url: "/packageF/tourAround/tourSearchPage/tourSearchPage?keyword=".concat(this.data.keyWord, "&city=").concat(this.data.city, "&latitude=").concat(this.data.latitude, "&longitude=").concat(this.data.longitude, "&cityCode=").concat(this.data.cityCode)
        });
    },
    tapKeyWord: function(t) {
        var a = t.currentTarget.dataset.name;
        wx.navigateTo({
            url: "/packageF/tourAround/tourSearchPage/tourSearchPage?keyword=".concat(a, "&city=").concat(this.data.city, "&latitude=").concat(this.data.latitude, "&longitude=").concat(this.data.longitude, "&cityCode=").concat(this.data.cityCode)
        });
    },
    deleHistory: function() {
        wx.setStorageSync("searchHistory"), this.setData({
            searchHistory: []
        });
    },
    onShow: function() {
        try {
            var t = wx.getStorageSync("searchHistory") || [];
            this.setData({
                searchHistory: JSON.parse(t)
            });
        } catch (t) {
            console.log(t);
        }
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});